import numpy as np

# save
a2=np.array([[1,2,3],
             [4,5,6],
             [7,8,9]])
np.save('array',a2)
a1=np.arange(8)
np.savez('arrays',array_a=a1,array_b=a2)
np.savez_compressed('arrays_compressed',array_a=a1,array_b=a2)
# read
a=np.load('array.npy')
print(a)
arr=np.load('arrays.npz')
print(arr['array_a'])
print(arr['array_b'])
arrc=np.load('arrays_compressed.npz')
print(arrc['array_a'])
print(arrc['array_b'])
